number to number array

51

convert array to number -

let x = [1,2,3,4,5]
let num = +x.join("")

convert array to number js -

var arrayOfNumbers = arrayOfStrings.map(Number);

number to number array -

public int[] IntegerArrayNum(int num)
    {
        var ls = new List<int>();
        foreach ( var i in num.ToString().ToCharArray())
        ls.Add(Convert.ToInt32(i.ToString()));
        return ls.ToArray();
    }

Comments

Submit
0 Comments